<%-- 
    Document   : productMaintenance
    Created on : Jun 5, 2012, 2:25:27 PM
    Author     : Owner
--%>

<%@include file="/jsp/adminTop.jsp" %>

<html>
    <head>
        <title>Product Maintenance</title>             
    </head>
    <body>
        <div class="clear"></div>
        <table cellspacing="5px" width="100%" align="center">
            <tr>
                <td>
                    <table cellspacing="5px" width="100%" align="center">
                        <tr>
                            <td style="vertical-align: top;" width="20%">
                                <%@include file="/jsp/right.jsp" %>
                            </td>
                            <td style="vertical-align: top;" width="80%">
                                <div class="page-title"><h1>Manage Products</h1></div>
                                <table align="center" border="1" cellspacing="5px" width="100%" >
                                    <tr>
                                        <td width="20%" style="vertical-align: bottom;">
                                            <a href="./product.do?action=showAddProduct"><span>Add New Product</span></a>
                                        </td>
                                        <td width="80%" align="right">
                                            <html:form action="/product" method="post">
                                                <table align="center" border="1" cellspacing="5px">
                                                    <tr>
                                                        <td align="right">Show Products containing the phrase:<html:text property="product"/></td>
                                                        <td style="vertical-align: bottom;">
                                                            <a onclick="javascript:searchProduct('./product.do?action=searchProductByPhrase','ProductBean')">
                                                                <img alt="Find" src="images/find.png" onmouseover="src='images/find-hover.png'" onmouseout="src='images/find.png'" />
                                                            </a>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">Product Start With:
                                                            <html:select property="productName" style="width:80px;">
                                                                <html:option value="All">All</html:option>
                                                                <html:option value="A">A</html:option><html:option value="B">B</html:option><html:option value="C">C</html:option><html:option value="D">D</html:option><html:option value="E">E</html:option><html:option value="F">F</html:option>
                                                                <html:option value="G">G</html:option><html:option value="H">H</html:option><html:option value="I">I</html:option><html:option value="J">J</html:option><html:option value="K">K</html:option><html:option value="L">L</html:option>
                                                                <html:option value="M">M</html:option><html:option value="N">N</html:option><html:option value="O">O</html:option><html:option value="P">P</html:option><html:option value="Q">Q</html:option><html:option value="R">R</html:option>
                                                                <html:option value="S">S</html:option><html:option value="T">T</html:option><html:option value="U">U</html:option><html:option value="V">V</html:option><html:option value="W">W</html:option><html:option value="X">X</html:option>
                                                                <html:option value="Y">Y</html:option><html:option value="Z">Z</html:option><html:option value="0">0</html:option><html:option value="1">1</html:option><html:option value="2">2</html:option><html:option value="3">3</html:option>
                                                                <html:option value="4">4</html:option><html:option value="5">5</html:option><html:option value="6">6</html:option><html:option value="7">7</html:option><html:option value="8">8</html:option><html:option value="9">9</html:option>
                                                            </html:select>
                                                        </td>
                                                        <td style="vertical-align: bottom;">
                                                            <a onclick="javascript:searchProduct('./product.do?action=searchProductByName','ProductBean')">
                                                                <img alt="Find" src="images/find.png" onmouseover="src='images/find-hover.png'" onmouseout="src='images/find.png'" />
                                                            </a>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">Status:
                                                            <html:select property="productStatusId">
                                                                <html:option value="0">--Status--</html:option>
                                                                <html:options collection="statusList" property="key" labelProperty="value"/>
                                                            </html:select>
                                                        </td>
                                                        <td style="vertical-align: bottom;">
                                                            <a onclick="javascript:searchProduct('./product.do?action=searchProductByStatus','ProductBean')">
                                                                <img alt="Find" src="images/find.png" onmouseover="src='images/find-hover.png'" onmouseout="src='images/find.png'" />
                                                            </a>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">Category:
                                                            <html:select property="productCategoryId">
                                                                <html:option value="0">--Select--</html:option>
                                                                <html:options collection="parentCategList" property="key" labelProperty="value"/>
                                                            </html:select>
                                                        </td>
                                                        <td style="vertical-align: bottom;">
                                                            <a onclick="javascript:searchProduct('./product.do?action=searchProductByCategory','ProductBean')">
                                                                <img alt="Find" src="images/find.png" onmouseover="src='images/find-hover.png'" onmouseout="src='images/find.png'" />
                                                            </a>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">Brand:
                                                            <html:select property="productBrandId">
                                                                <html:option value="0">--Brands--</html:option>
                                                                <html:options collection="brandList" property="key" labelProperty="value"/>
                                                            </html:select>
                                                        </td>
                                                        <td style="vertical-align: bottom;">
                                                            <a onclick="javascript:searchProduct('./product.do?action=searchProductByBrand','ProductBean')">
                                                                <img alt="Find" src="images/find.png" onmouseover="src='images/find-hover.png'" onmouseout="src='images/find.png'" />
                                                            </a>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </html:form>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <table border="0" cellspacing="10px" id="results" align="center" width="100%">
                                                <colgroup>
                                                    <col width="5%">
                                                    <col width="25%">
                                                    <col width="20%">
                                                    <col width="10">
                                                    <col width="10%">
                                                    <col width="3%">
                                                    <col width="5%">
                                                    <col width="17%">
                                                    <col width="5%">
                                                </colgroup>
                                                <tr>
                                                    <td><strong>ID</strong></td>
                                                    <td><strong>Product</strong></td>
                                                    <td><strong>Category</strong></td>
                                                    <td><strong>Brand</strong></td>
                                                    <td><strong>Price</strong></td>
                                                    <td><strong>Qty</strong></td>
                                                    <td><strong>Status</strong></td>
                                                    <td><strong>Edit / Test</strong></td>
                                                    <td><strong>Delete</strong></td>
                                                </tr>
                                                <logic:notPresent name="productList" scope="request">
                                                    <tr>
                                                        <td colspan="9"> No records Found </td>
                                                    </tr>
                                                </logic:notPresent>
                                                <logic:present name = "productList" scope="request">
                                                    <logic:iterate id="products" name="productList" scope="request">
                                                        <tr>
                                                            <td><bean:write name="products" property="productId"/></td>
                                                            <td><bean:write name="products" property="productName"/></td>
                                                            <td><bean:write name="products" property="productCategory"/></td>
                                                            <td><bean:write name="products" property="productBrand"/></td>
                                                            <td><bean:write name="products" property="productPrice"/></td>
                                                            <td><bean:write name="products" property="productQty"/></td>
                                                            <td><bean:write name="products" property="productStatus"/></td>
                                                            <td>[<a href="./product.do?action=showEditProduct&productid=<bean:write name="products" property="productId"/>" >Edit</a> | <a href="./product.do?action=showProductDetails"> Test</a>]</td>
                                                            <td><a href="./product.do?action=deleteProduct&productId=<bean:write name="products" property="productId"/>" >Delete</a></td>
                                                        </tr>
                                                    </logic:iterate>
                                                </logic:present>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                                <div id="pageNavPosition" align="center"></div>

                                <script type="text/javascript"><!--
                                    var pager = new Pager('results', 10);
                                    pager.init();
                                    pager.showPageNav('pager', 'pageNavPosition');
                                    pager.showPage(1);
                                    //--></script>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td><%@include file="/jsp/footer.jsp" %></td>
            </tr>
        </table>

        <div class="clear"></div>
        <table border="1" cellspacing="8px" align="center" width="100%">
            <tr>

            </tr>
        </table>

    </body>
</html>
